]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-global: Add MetaContext getter
authorJonas Ådahl <jadahl@gmail.com>
Wed, 17 Aug 2022 14:25:31 +0000 (16:25 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Fri, 25 Nov 2022 21:09:37 +0000 (22:09 +0100)
Start to use it instead of using g_object_get().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>

src/shell-global.c
src/shell-global.h

index 0ccdb102995ed9c8a8eca99596bf3863c4f0f5c3..baa28e6d651ab7193ba0264cbe8c719c3ac0cbd7 100644 (file)
@@ -821,6 +821,17 @@ shell_global_set_stage_input_region (ShellGlobal *global,
   sync_input_region (global);
 }
 
+/**
+ * shell_global_get_context:
+ *
+ * Return value: (transfer none): The #MetaContext
+ */
+MetaContext *
+shell_global_get_context (ShellGlobal *global)
+{
+  return global->meta_context;
+}
+
 /**
  * shell_global_get_stage:
  *
@@ -1269,7 +1280,7 @@ shell_global_reexec_self (ShellGlobal *global)
    */
   pre_exec_close_fds ();
 
-  g_object_get (global, "context", &meta_context, NULL);
+  meta_context = shell_global_get_context (global);
   meta_context_restore_rlimit_nofile (meta_context, NULL);
 
   meta_display_close (shell_global_get_display (global),
index 8d8238ca220f501e33fb4c6e61f70381150d9029..87f4e590c5fb272245b92da94d9c12493da6101b 100644 (file)
@@ -15,6 +15,7 @@ G_DECLARE_FINAL_TYPE (ShellGlobal, shell_global, SHELL, GLOBAL, GObject)
 
 ShellGlobal          *shell_global_get                       (void);
 
+MetaContext          *shell_global_get_context               (ShellGlobal *global);
 ClutterStage         *shell_global_get_stage                 (ShellGlobal *global);
 MetaDisplay          *shell_global_get_display               (ShellGlobal *global);
 GList                *shell_global_get_window_actors         (ShellGlobal *global);